#define _CRT_SECURE_NO_WARNINGS 1

using namespace std;
#include<vector>
#include<iostream>
#include"BSTree.h"

void test1()
{
	int s[] = { 3,15,1,99,5,2,100,130,9,4 };
	xiaolin::BSTree<int> s1;

	for (auto x : s)
	{
		s1.insert(x);
	}
	 s1.inorder() ;
	 cout << endl;
	 s1.eraseR(3);
	 s1.inorder();
	 

	 s1.eraseR(100);
	 s1.inorder();
	

	 s1.eraseR(15);
	 s1.inorder();
	 

	
	 s1.eraseR(99);
	 s1.inorder();
	 xiaolin::BSTree<int> s2(s1);
	 s2.inorder();
	 xiaolin::BSTree<int> s3;
	 s3 = s2;
	 s3.inorder();

}
void test2()
{
	const int N = 1000;
	vector<int> v;
	v.reserve(N);
	srand(time(0));

	for (size_t i = 0; i < N; i++)
	{
		v.push_back(i);
	}

	xiaolin::BSTree<int> s;
	for (auto e : v)
	{
		s.inserR(e);
		//cout << "Insert:" << e << "->" << t.IsBalance() << endl;
	}
	s.inorder();
	
}

int main()
{
	test1();
	return 0;
}